package cn.johnyu.controller;

import cn.johnyu.service.BookService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@Controller
public class TestController {
    @Autowired
    private BookService bookService;
    public TestController() {
        System.out.println("TestController....");
    }

    @GetMapping("/test")
    public String test(Model model) {
        String info = bookService.findAll();
        model.addAttribute("info", info);


        return "success";
    }
}
